﻿@using Cineplex.Contacts.Extensions
@model Cineplex.Contacts.Models.Contact

@{
    ViewBag.Title = "Edit";
}
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")"></script>      
<h2>Edit contact</h2>
<fieldset>    
    <legend>Member information</legend>    
    <div>
        @{ Html.EnableClientValidation(); }
        @using (Html.Configurator("contact-edit-form")
              .PostTo("Edit", "Contact")
              .Begin())
        {
            @Html.ValidationSummary(true)
            <table width="100%" style="padding: 2px; margin: 2px">
             <tr style="height: 22px;">
                    <td style="width: 18%">
                        Mã thẻ / Member card no.<span style="color:Red">*</span>
                    </td>
                    <td>
                        @Html.TextBoxFor(model=>model.MemberID, new { @class = "required" })                                                
                    </td>
                </tr>    
                <tr style="height: 22px;">
                    <td style="width: 18%">
                        Loại thẻ / Card type<span style="color:Red">*</span>
                    </td>
                    <td>
                        @Html.RadioButton("cardtype", "Friend", true, "Friend", "Friend")
                        @Html.RadioButton("cardtype", "Best friend", false, "BestFriend", "Best Friend", true)                        
                    </td>
                </tr>     
                  <tr style="height: 22px">
                    <td style="width: 18%">
                        Ngày đăng ký / Since
                    </td>
                    <td >
                        @Html.Telerik().DatePickerFor(o=>o.Since).Name("Since").Value(DateTime.Now).Format("dd/MM/yyyy").InputHtmlAttributes(new { @class = "required date" })
                        &nbsp;&nbsp;&nbsp;&nbsp;<span style="vertical-align:middle; position:relative;marign-top:6px">Ngày hết hạn / Expired</span> @Html.Telerik().DatePickerFor(o=>o.Expired).Name("Expired").Format("dd/MM/yyyy").InputHtmlAttributes(new { @class = "required date" })
                    </td>
                </tr>
                <tr style="height: 22px;">
                    <td style="width: 18%">
                        Tên / Name<span style="color:Red">*</span>
                    </td>
                    <td>
                        @Html.TextBoxFor(model=>model.Name, new { @class = "required" })
                    </td>
                </tr>              
                <tr style="height: 22px">
                    <td style="width: 18%">
                        Email<span style="color:Red">*</span>
                    </td>
                    <td>
                        @Html.TextBoxFor(o=>o.Email, new { @class = "required email" })
                    </td>
                </tr>
                <tr style="height: 22px">
                    <td>
                        Facebook
                    </td>
                    <td>
                        @Html.TextBoxFor(o=>o.Facebook)
                    </td>
                </tr>
                <tr style="height: 22px">
                    <td style="width: 18%">
                        Nghề nghiệp / Occupation
                    </td>
                    <td>
                        @Html.TextBoxFor(o=>o.Occupation)
                    </td>
                </tr>
                <tr style="height: 22px">
                    <td style="width: 18%">
                        Điện thoại / Phone<span style="color:Red">*</span>
                    </td>
                    <td>
                        @Html.TextBoxFor(o=>o.HandPhone, new { @class = "required number" })
                    </td>
                </tr>
                <tr style="height: 22px">
                    <td style="width: 18%">
                        Sinh nhật / Birthday
                    </td>
                    <td>
                        @Html.Telerik().DatePickerFor(o=>o.DateOfBirth).Name("DateOfBirth").Format("dd/MM/yyyy").InputHtmlAttributes(new { @class = "required date" })
                    </td>
                </tr>
                <tr style="height: 22px">
                    <td style="width: 18%">
                        Địa chỉ / Address
                    </td>
                    <td>
                        @Html.TextBoxFor(o=>o.Address)
                    </td>
                </tr>

                 <tr style="height: 22px">
                    <td>
                        Thành phố / City
                    </td>
                    <td>                        
                        <select name="City" id="City">                
                <option value="29">Hồ Chí Minh</option>
<option value="24" selected="selected">Hà Nội</option>
<option value="71">ĐBSCL</option>
<option value="2">An Giang</option>
<option value="3">Bà Rịa</option>
<option value="4">Bắc cạn</option>
<option value="5">Bắc Giang</option>
<option value="6">Bạc Liêu</option>
<option value="7">Bắc Ninh</option>
<option value="8">Bến Tre</option>
<option value="9">Biên Hòa</option>
<option value="10">Bình Định</option>
<option value="11">Bình Dương</option>
<option value="12">Bình Phước</option>
<option value="13">Bình Thuận</option>
<option value="14">Cà Mau</option>
<option value="15">Cần Thơ</option>
<option value="16">Cao Bằng</option>
<option value="17">Đà Nẵng</option>
<option value="18">Đắc Lắc</option>
<option value="69">Điện Biên</option>
<option value="19">Đồng Nai</option>
<option value="20">Đồng Tháp</option>
<option value="21">Gia Lai</option>
<option value="22">Hà Giang</option>
<option value="23">Hà Nam</option>
<option value="25">Hà Tây</option>
<option value="26">Hà Tĩnh</option>
<option value="27">Hải Dương</option>
<option value="28">Hải Phòng</option>
<option value="30">Hòa Bình</option>
<option value="31">Huế</option>
<option value="32">Hưng Yên</option>
<option value="33">Khánh Hòa</option>
<option value="34">Kon Tum</option>
<option value="35">Lai Châu</option>
<option value="36">Lâm Đồng</option>
<option value="37">Lạng Sơn</option>
<option value="38">Lào Cai</option>
<option value="39">Long An</option>
<option value="40">Nam Định</option>
<option value="41">Nghệ An</option>
<option value="42">Ninh Bình</option>
<option value="43">Ninh Thuận</option>
<option value="44">Phú Thọ</option>
<option value="45">Phú Yên</option>
<option value="46">Quảng Bình</option>
<option value="47">Quảng Nam</option>
<option value="48">Quảng Ngãi</option>
<option value="49">Quảng Ninh</option>
<option value="50">Quảng Trị</option>
<option value="51">Sóc Trăng</option>
<option value="52">Sơn La</option>
<option value="53">Tây Ninh</option>
<option value="54">Thái Bình</option>
<option value="55">Thái Nguyên</option>
<option value="56">Thanh Hóa</option>
<option value="57">Thừa Thiên-Huế</option>
<option value="58">Tiền Giang</option>
<option value="59">Trà Vinh</option>
<option value="60">Tuyên Quang</option>
<option value="61">Kiên Giang</option>
<option value="62">Vĩnh Long</option>
<option value="63">Vĩnh Phúc</option>
<option value="64">Vũng Tàu</option>
<option value="65">Yên Bái</option>
<option value="66">Khác</option>
<option value="70">Quốc tế</option>
<option value="72">Hậu Giang</option>
            </select>
                    </td>
                </tr>

                <tr style="height: 22px">
                    <td>
                        Quận / District
                    </td>
                    <td>
                        @Html.TextBoxFor(o=>o.District)
                    </td>
                </tr>
               
               
            </table>
            <div style="text-align: right; padding-top:10px">
                <input type="submit" class="t-button t-state-default" value="Save / Lưu" />
            </div>
        }
    </div>
</fieldset>
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
<script type="text/javascript">
    $(document).ready(function () {
        $("#contact-edit-form").validate({
            rules: {
                MemberID: { required: true, maxlength: 50 },
                Name: { required: true, maxlength: 50 },
                Email: { required: true, email: true }
            }
        });
    });
</script>